{include file='public/head'}
<body>
<style type="text/css" media="screen">
header {
    color: black;
}
</style>


<div class="x-body" >
	<form class="layui-form" id='mainForm' method="post" action="change">

		<input type="hidden" name="id" value="{$pros.id}">
		<input type="hidden" name="pId" value="{$pros.pId}">
		<div class="layui-form-item">
		    <label class="layui-form-label">工单来源:</label>
		 		<label class="layui-form-label">
				    {switch name="pros['resource']" }
					    {case value="1"}
					    <span class="layui-badge layui-bg-green" style="width: 50px;height: 20px;">微信</span>
					    {/case}
					    {case value="2"}
					    <span class="layui-badge layui-bg-cyan" style="width: 50px;height: 20px;">电话</span>
					    {/case}
					    {default /}
					    <span class="layui-badge layui-bg-blue" style="width: 50px;height: 20px; ">网站</span>
					{/switch}
		    	</label>  
		</div>

		<div class="layui-form-item">
                <label class="layui-form-label">
                    工单状态:
                </label>
                <div class="layui-input-block">
                	<input type="radio" value="1"   title="未处理"  name="status" {php} if($pros['status']==1){echo 'checked';} {/php}>
                    <input type="radio" value="2"  title="处理中"  name="status"  {php} if($pros['status']==2){echo 'checked';} {/php}>
                    <input type="radio" value="3"  title="已结束"  name="status"  {php} if($pros['status']==3){echo 'checked';} {/php}>
		    	
		    </div>
        </div>

		<div class="layui-form-item">
		    <label class="layui-form-label">状态说明:</label>
		    <div class="layui-input-block">
		      <textarea placeholder="请描述" lay-verify="required|exp" class="layui-textarea" name="exp"></textarea>
		    </div>
		</div>

		<div class="layui-form-item">
		    <div class="layui-input-block">
		      <button style="margin-left: 20%" class="layui-btn" lay-submit="" lay-filter="toSubmit" id="submit" >提交</button>
		      <button id="reset" type="reset" class="layui-btn layui-btn-primary">重置</button>
		    </div>
		</div>

	</form>
</div>
</body>
{include file='public/foot'}
<script type="text/javascript">
	

	$(document).ready(function(){
    		var form = layui.form;
			var layer = layui.layer;
			
	    var options = {
		      type:'post',           //post提交
		      // url:'http://ask.tongzhuo100.com/server/****.php?='+Math.random(),   //url
		      dataType:"json",        //json格式
		      data:{},    //如果需要提交附加参数，视情况添加
		      clearForm: false,        //成功提交后，清除所有表单元素的值
		      resetForm: false,        //成功提交后，重置所有表单元素的值
		      cache:false,          
		      async:false,          //同步返回
		      success:function(data){
		      	console.log(data);
		      	if(data.code==0){
		      		layer.msg(data.msg);
		      	}else{
		      		layer.msg(data.msg,{icon:1,time:500},function(){
		      			$("#reset").click();
		      			x_admin_close();
		      			parent.location.reload();
		      		});
		      	}
		        //服务器端返回处理逻辑
		      },
		      error:function(XmlHttpRequest,textStatus,errorThrown){
		        layer.msg('操作失败:服务器处理失败');
		      }
		    }; 

	    // bind form using 'ajaxForm' 
	    $('#mainForm').ajaxForm(options).submit(function(data){}); 
	});
</script>
</html>
